// 导入 路由
import VueRouter from 'vue-router'

import homeContainer from './components/tabbar/homeContainer.vue'
import vipContainer from './components/tabbar/vipContainer.vue'
import shopCarContainer from './components/tabbar/shopCarContainer.vue'
import searchContainer from './components/tabbar/searchContainer.vue'
import newsList from './components/news/newsList.vue'
import newsInfo from './components/news/newsInfo.vue'
import photos from './components/photos/photoList.vue'
import photoInfo from './components/photos/photoInfo.vue'
import goodsList from './components/goods/goodsList.vue'
import goodsInfo from './components/goods/goodsInfo.vue'
import goodsDesc from './components/goods/goodsDesc.vue'
import goodsComment from './components/goods/goodsComment.vue'

// 创建路由对象
var router = new VueRouter({
    routes: [ // 路由匹配规则

        {
            path: '/',
            redirect: "/home"
        },
        {
            path: '/home',
            component: homeContainer,
        },
        {
            path: '/vip',
            component: vipContainer
        },
        {
            path: '/shopcar',
            component: shopCarContainer
        },
        {
            path: '/search',
            component: searchContainer
        },
        {
            path: '/home/newslist',
            component: newsList
        },
        {
            path: '/home/newsinfo/:id',
            component: newsInfo
        },
        {
            path: '/home/photolist',
            component: photos
        },
        {
            path: '/home/photoinfo/:id',
            component: photoInfo
        },
        {
            path: '/home/goodslist',
            component: goodsList
        },
        {
            path: '/home/goodsinfo/:id',
            component: goodsInfo,
            name: 'goodsinfo'
        },
        {
            path: '/home/goodsdesc/:id',
            component: goodsDesc,
            name: "goodsDesc"
        },
        {
            path: '/home/goodscomment/:id',
            component: goodsComment,
            name: "goodsComment"
        }
    ],
    linkActiveClass: "mui-active" // 路由选中的样式
});
export default router